package manager.dao.impl;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.SqlSession;

import manager.dao.UserDAO;
import manager.vo.User;

public class UserDAOImpl implements  UserDAO{
	private UserDAO userDAO = null;
	public UserDAOImpl(SqlSession session) throws Exception{
		this.userDAO = session.getMapper(UserDAO.class);
	}
	//查询(id,userid,name,identity,start,end)
    public List<User> selectUser(Map<String,Object>map) throws Exception{
    	List<User> list = null;
    	list = this.userDAO.selectUser(map);
    	return list;
    }
    //添加
    public int addUser(User user) throws Exception{
    	int count = 0;
    	count = this.userDAO.addUser(user);
    	return count;
    }
    //登录,根据昵称或者userid
    public List<User> checkLogin(User user) throws Exception{
    	List<User> list = null;
    	list = this.userDAO.checkLogin(user);
    	return list;
    }
}
